<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <button @click="show = !show">切换</button>

        <div v-show="show">我是div - 用v-show</div>
        <div v-if="show">我是div - 用v-if</div>

        <h3>根据年龄决定做什么事</h3>
        <div v-if="age>=18">去网吧偷耳机</div>
        <div v-else>去大街捡垃圾</div>


        <h3>根据班长有多少钱，来决定显示什么内容</h3>

        <div v-if="money >= 1000">
            班长带我去洗脚
        </div>

        <div v-else-if="money>=500">
            班长带我去吃饭
        </div>

        <div v-else-if="money>=200">
            班长带我去买饮料
        </div>

        <div v-else>
            把班长毒打一顿，然后叫他回去取钱
        </div>


    </div>

    <script src="./vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                show: true,
                money: 2000,
                age: 19
            }
        })
    </script>
</body>

</html>